package collection;

import java.util.NoSuchElementException;

public class MyQueue<E> {
    private MyLinkedList<E> myLinkedList;

    public MyQueue() {
        this.myLinkedList = new MyLinkedList<>();
    }

    boolean add(E e) {
        myLinkedList.add(e);
        return true;
    }

    boolean offer(E e) {
        return add(e);
    }

    E remove() {

        return myLinkedList.remove(0);
    }

    E poll() {
        return remove();
    }
    E peek() {
        return myLinkedList.get(0);
    }

}
